import request from '@/utils/request';

// 获取订单列表
export const getOrders = (params) => {
  return request({
    url: '/orders',
    method: 'get',
    params: {
      status: params.status,
      page: params.page,
      limit: params.limit
    }
  });
};

// 创建订单
export function createOrder(data) {
  return request({
    url: '/orders',
    method: 'post',
    data
  });
}

// 获取订单详情
export const getOrderDetail = (id) => {
  return request({
    url: `/orders/${id}`,
    method: 'get'
  });
};

// 评价订单
export const commentOrder = (orderId, data) => {
  return request({
    url: `/orders/${orderId}/comment`,
    method: 'post',
    data
  });
}; 